<?php

$config = array(
    'services/user_reg' => array(
        array(
            'field' => 'username',
            'label' => 'Username',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower|is_unique[users.username]'
        ),
        array(
            'field' => 'password',
            'label' => 'Password',
            'rules' => 'trim|required|min_length[3]|max_length[30]|special_characters'
        ),
        array(
            'field' => 'password_confirmation',
            'label' => 'Password Confirmation',
            'rules' => 'trim|required|matches[password]'
        ),
        array(
            'field' => 'email',
            'label' => 'Email',
            'rules' => 'trim|required|max_length[90]|valid_email|is_unique[users.email]'
        ),
        array(
            'field' => 'firstname',
            'label' => 'Firstname',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'secondname',
            'label' => 'Secondname',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'lastname1',
            'label' => 'Lastname1',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'lastname2',
            'label' => 'Lastname2',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'id_number',
            'label' => 'ID number',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        )
    ),
    'services/login' => array(
        array(
            'field' => 'username',
            'label' => 'Username',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'password',
            'label' => 'Password',
            'rules' => 'trim|required|min_length[3]|max_length[30]|special_characters'
        )
    ),
    'services/get_products_from_store' => array(
        array(
            'field' => 'store_id',
            'label' => 'Store ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[stores.id]'
        )
    ),
    
    'services/store_reg' => array(    
        array(
            'field' => 'name',
            'label' => 'name',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'motto',
            'label' => 'motto',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'primary_telephone',
            'label' => 'primary telephone',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'province',
            'label' => 'province',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'canton',
            'label' => 'canton',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'district',
            'label' => 'district',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'address_line_1',
            'label' => 'address line #1',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'address_line_2',
            'label' => 'address line #2',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'schedule',
            'label' => 'schedule',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        )
    ),
    'services/store_edit' => array(    
        array(
            'field' => 'id',
            'label' => 'Store ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[stores.id]'
        ),
        array(
            'field' => 'name',
            'label' => 'name',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'motto',
            'label' => 'motto',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'primary_telephone',
            'label' => 'primary telephone',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'province',
            'label' => 'province',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'canton',
            'label' => 'canton',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'district',
            'label' => 'district',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'address_line_1',
            'label' => 'address line #1',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'address_line_2',
            'label' => 'address line #2',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'schedule',
            'label' => 'schedule',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        )
    ),
   'services/store_del' => array(
        array(
            'field' => 'id',
            'label' => 'Store ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[stores.id]'
        )
    ),
    
    'services/product_add' => array(
        array(
            'field' => 'store_id',
            'label' => 'Store ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[stores.id]'
        ),
        array(
            'field' => 'name',
            'label' => 'Name',
            'rules' => 'trim|required|max_length[90]|special_characters|strtolower'
        ),
        array(
            'field' => 'description',
            'label' => 'Description',
            'rules' => 'trim'
        ),
        array(
            'field' => 'price',
            'label' => 'Price',
            'rules' => 'trim|required|max_length[30]|numeric'
        )
    ),
    
    'services/product_edit' => array(
        array(
            'field' => 'id',
            'label' => 'Product ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[products.id]'
        ),
        array(
            'field' => 'name',
            'label' => 'Name',
            'rules' => 'trim|required|max_length[90]|special_characters|strtolower'
        ),
        array(
            'field' => 'description',
            'label' => 'Description',
            'rules' => 'trim'
        ),
        array(
            'field' => 'price',
            'label' => 'Price',
            'rules' => 'trim|required|max_length[30]|numeric'
        )
    ),
    'services/product_del' => array(
        array(
            'field' => 'id',
            'label' => 'Product ID',
            'rules' => 'trim|required|max_length[30]|numeric|exists[products.id]'
        )
    ),
    
    
    
    
    
    
    
    
    
     'services/user_edit' => array(
        array(
            'field' => 'username',
            'label' => 'Username',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower|is_unique[users.username]'
        ),
        array(
            'field' => 'password',
            'label' => 'Password',
            'rules' => 'trim|required|min_length[3]|max_length[30]|special_characters'
        ),
        array(
            'field' => 'password_confirmation',
            'label' => 'Password Confirmation',
            'rules' => 'trim|required|matches[password]|sha1'
        ),
        array(
            'field' => 'email',
            'label' => 'Email',
            'rules' => 'trim|required|max_length[90]|valid_email|is_unique[users.email]'
        ),
        array(
            'field' => 'firstname',
            'label' => 'Firstname',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'secondname',
            'label' => 'Secondname',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'lastname1',
            'label' => 'Lastname1',
            'rules' => 'trim|required|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'lastname2',
            'label' => 'Lastname2',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        ),
        array(
            'field' => 'id_number',
            'label' => 'ID number',
            'rules' => 'trim|max_length[30]|special_characters|strtolower'
        )
    ),
);


/* End of file form_validation.php */
/* Location: ./application/config/form_validation.php */